package com.lagou.homework02;

/**
 * 通话套餐类
 * 特征：通话时长、短信条数、每月资费
 * 行为：显示所有套餐信息
 */
public class CallPackage extends MobilePackage implements CallServicesInterface{
    //封装(1)私有化成员变量 使用private关键字修饰
    private int callTime;
    private int smsNum;
    //封装(3)在有参构造中调用set方法
    //super(monthlyCost) 调用父类的有参构造初始化父类中的成员变量；
    public CallPackage(String monthlyCost, int callTime, int smsNum) {
        super(monthlyCost);
        setCallTime(callTime);
        setSmsNum(smsNum);
    }

    public int getCallTime() {
        return callTime;
    }
    //封装(2)提供公有的get和set方法，并在set方法中进行合理值的判断；
    public void setCallTime(int callTime) {
        this.callTime = callTime;
    }

    public int getSmsNum() {
        return smsNum;
    }

    public void setSmsNum(int smsNum) {
        this.smsNum = smsNum;
    }

    public CallPackage() {
        super();
    }


    @Override
    public void show() {
        System.out.println("套餐信息为：通话时长：" + getCallTime() + ", " +
                "短信条数: " + getSmsNum() + ", 每月资费: " + super.getMonthlyCost());
    }

    @Override
    public void test(int callTime, String cardType) {
        System.out.println("这是通话服务接口中抽象方法的重写！");
    }
}
